<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>综合管理平台</title>
  <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body class="Login">
  <!--Login-开始-->

  <div class="Login_heand dk">
    <a href="#" class="Login_logo fl">
      <img src="images/logo.png" class="fl" />
      <p class="fl">综合管理平台</p>
      <div class="clear"></div>
    </a>
  </div>

  <div class="Login_k">
    <div class="Login_T">
      密码登录
      <p></p>
    </div>
    <!--登录-开始-->
    <form class="Login_dl">
      <div class="Login_row">
        <input name="zhanghao" id="user" type="text" value="" class="Login_input Login_inp1" placeholder="用户名" />
      </div>
      <div class="Login_row">
        <input name="password" id="pass" type="password" value="" class="Login_input Login_inp2" placeholder="密码" />
      </div>
      <a href="#" class="Login_dla" id="dl">登录</a>
      <label class="Login_pitch fl">
        <input type="checkbox" name="checkbox01" class="fl" />
        <div class="fl">自动登录</div>
        <div class="clear"></div>
      </label>
      <div class="Login_wj fr">
        <a href="register.html">用户注册</a>
      </div>
      <div class="clear"></div>
    </form>
    <!--登录-结束-->
  </div>
  <!--Login-结束-->
  <script>
    document.getElementById("dl").onclick = function () {
      var username = document.getElementById('user').value;
      var password = document.getElementById('pass').value;
      var userInfo = JSON.parse(localStorage.getItem('userInfo'));
      if (userInfo.username == username && userInfo.password == password) {
        window.location.href = 'index.html';
      } else {
        alert('用户名或密码错误');
        return;
      }
    }
   
  </script>
</body>

</html>